function fn(n) {
    var result = []
    var middle = Math.ceil(n / 2)
    for (var i = 1; i < middle; i++) {
        for (var j = 2; ; j++) {
            var total = (i + i + j - 1) * j / 2
            if (total > n) {
                break
            } else if (total === n) {
                 result.push(createArr(i, j))
                break
            }
        }
    }
    return result
}

function createArr(i, j) {
      var newArr = []
    for (var t = 0; t < j; t++) {
        newArr[t] = i+t
    }
     return newArr
}

console.log(fn(15))